package service

import (
	"context"
	"monoblog/common/register"
	"monoblog/domain/model"
)

func GetInterestService() InterestService {
	return register.GetInstance[InterestService]("InterestService")
}

type InterestService interface {

	// UserToFollow 当前用户去关注id用户
	UserToFollow(ctx context.Context, followId string, userId string) error

	// UserCancelFollow 当前用户去取消关注id用户
	UserCancelFollow(ctx context.Context, followId string, userId string) error

	// UserToBlack 当前用户去拉黑id用户
	UserToBlack(ctx context.Context, blackId string, userId string) error

	// UserCancelBlack 当前用户去取消拉黑id用户
	UserCancelBlack(ctx context.Context, blackId string, userId string) error

	// FavoriteTheArticle 收藏文章
	FavoriteTheArticle(ctx context.Context, blogId string, userId string) error

	// CancelFavoriteTheArticle 取消收藏文章
	CancelFavoriteTheArticle(ctx context.Context, blogId string, userId string) error

	// LikeTheArticle 给文章点赞
	LikeTheArticle(ctx context.Context, blogId string, userId string) error

	// CancelLikeTheArticle 取消给文章点赞
	CancelLikeTheArticle(ctx context.Context, blogId string, userId string) error

	// LikeTheComment 给评论点赞
	LikeTheComment(ctx context.Context, commentId string, userId string) error

	// CancelLikeTheComment 取消给评论点赞
	CancelLikeTheComment(ctx context.Context, commentId string, userId string) error

	// StatsAtComment 是否已点赞
	StatsAtComment(ctx context.Context, commentId string, userId string) (map[string]bool, error)

	// StatsAtBlog 是否已点赞、已收藏
	StatsAtBlog(ctx context.Context, blogId string, userId string) (map[string]bool, error)

	// StatsAtUser 是否已关注、已拉黑
	StatsAtUser(ctx context.Context, targetUserId string, userId string) (map[string]bool, error)

	GetInterest(ctx context.Context, userId string) (*model.UserInterest, error)

	GetFavorites(ctx context.Context, userId string) ([]string, error)
}
